**************************************************************************************************

******** The effect of COVID-19 lockdowns on political support: Some good news for democracy? ****


                *REPLICATION OF APPENDIX* 

clear all
use Data.dta

*******TABLE A1*******

estpost sum Stfdem Trust partygov partygov2 Ideology   Pol   Age Female Rural Immigrant University Vote  if Treatment==0
est store a
estpost sum Stfdem Trust partygov partygov2 Ideology   Pol   Age Female Rural Immigrant University Vote  if Treatment==1
est store b

label var partygov "Support for PM party"

esttab a b, replace mtitles("\textbf{Before lockdown}" "\textbf{After lockdown}"  "\textbf{All}") style(tex)   refcat(Stfdem "\textbf{\emph{Political attitudes}}" Age   "\textbf{\emph{Socio-demographics}}" , nolabel) cells("min max count mean(fmt(3)) sd(fmt(3))") varwidth(10)   label nonumber      booktabs 
	

*******FIGURE A1*******

	   grstyle init
	 grstyle set legend 2,  nobox
 
	 grstyle set graphsize 13cm 13cm

format Date %d
la var Policyday "Days before/after  general lockdown"
hist Policyday if Country==1, discrete percent  ytitle("Daily % of survey collection")  addplot(pci 0 0 20 0, lcolor(black) lpattern(longdash) lwidth(vthick)) legend(off) title("All countries")

hist Date if Country==1, discrete percent  addplot(pci 0 21989 20 21989, lcolor(black) lpattern(longdash) lwidth(vthick)) title("Austria") xtitle("")  ytitle("Daily % of survey collection")  legend(off)

hist Date if countryregion=="Denmark", discrete percent  addplot(pci 0 21991 20 21991, lcolor(black) lpattern(longdash) lwidth(vthick)) title("Denmark")  xtitle("")  ytitle("Daily % of survey collection")  legend(off)

hist Date if  countryregion=="France", discrete percent  addplot(pci 0 21990 25 21990, lcolor(black) lpattern(longdash) lwidth(vthick)) title("France")  xtitle("")  ytitle("Daily % of survey collection")  legend(off)

hist Date if  countryregion=="Italy", discrete percent  addplot(pci 0 21987 25 21987, lcolor(black) lpattern(longdash) lwidth(vthick))    xtitle("")  title("Italy")  ytitle("Daily % of survey collection")  legend(off)

hist Date if  countryregion=="Netherlands", discrete percent  addplot(pci 0 21990 25 21990, lcolor(black) lpattern(longdash) lwidth(vthick))    xtitle("")  title("Netherlands")  ytitle("Daily % of survey collection")  legend(off)

hist Date if countryregion=="Spain", discrete percent  addplot(pci 0 21988 25 21988, lcolor(black) lpattern(longdash) lwidth(vthick))   xtitle("")  title("Spain")  ytitle("Daily % of survey collection")  legend(off)

hist Date if countryregion=="United Kingdom", discrete percent  addplot(pci 0 21996 25 21996, lcolor(black) lpattern(longdash) lwidth(vthick))   xtitle("")  title("United Kingdom")  ytitle("Daily % of survey collection")  legend(off)
 
*******TABLE A2*******

clear all
use Data.dta
	
preserve
center      Age   Date  Date2  Deaths Cases  , inplace standardize  nolabel 

ebalance Treatment   Age Female Rural Immigrant University Vote  Country


local  CountryFE
local  TimeFE   
local  Demographics
local  Attitudes 
local  Weights


quietly: reg  Stfdem  Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  , vce(cluster Date)
est sto i1
estadd local CountryFE "Yes"
estadd local TimeFE "Yes"
estadd local  Demographics "Yes"
estadd local  Attitudes "Yes"
estadd local Weights "Yes" 

quietly: reg  Trust  Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  , vce(cluster Date)          
est sto i2
estadd local CountryFE "Yes"
estadd local TimeFE "Yes"
estadd local  Demographics "Yes"
estadd local  Attitudes "Yes"
estadd local Weights "Yes" 

quietly: reg  partygov  Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country , vce(cluster CL_var) 
est sto i3
estadd local CountryFE "Yes"
estadd local TimeFE "Yes"
estadd local  Demographics "Yes"
estadd local  Attitudes "Yes"

quietly: reg  partygov2  Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country , vce(cluster CL_var) 
est sto i4
estadd local CountryFE "Yes"
estadd local TimeFE "Yes"
estadd local  Demographics "Yes"
estadd local  Attitudes "Yes"

quietly:  reg Ideology Treatment  Deaths  Date Age Female Rural Immigrant University Vote  i.Country , vce(cluster CL_var)    
est sto i5
estadd local CountryFE "Yes"
estadd local TimeFE "Yes"
estadd local  Demographics "Yes"   
estadd local  Attitudes "Yes"


quietly:  reg Pol Treatment  Deaths  Date Age Female Rural Immigrant University Vote  i.Country , vce(cluster CL_var)    
est sto i6
estadd local CountryFE "Yes"
estadd local TimeFE "Yes"
estadd local  Demographics "Yes"   
estadd local  Attitudes "Yes"


esttab  i1 i2 i3 i4 i5 i6  , replace se obslast collabels(, none)  star(* 0.1 ** 0.05 *** 0.01)  wrap     booktabs mlabel("a" "b" "c.1" "c.2"  "d" "e"  )   nonumbers cells(b(star fmt(3)) se(fmt(3) par)) compress label title(Effect of lockdown on political support.)   drop(_cons *.Country )  gaps   stats(  CountryFE  TimeFE Demographics      N r2, fmt(a1 a2  a4   %9.0fc %9.3fc )  labels( `"Country FE"'  `"COVID-19 incidence"' `"Controls"'    `"N.obs"' `"R-squared"') )  mgroups("Political support" "Placebo", pattern(1 0 0 0 1 0  ) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 


*******FIGURE A2*******

clear all
use Data.dta
	
ritest Treatment _b[Treatment], reps(1000) cluster(CL_var)  strata(Country) kdensityplot: reg  Stfdem2  Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country , vce(cluster CL_var)

ritest Treatment _b[Treatment], reps(1000) cluster(CL_var)  strata(Country) kdensityplot: reg  Trust2 Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country , vce(cluster CL_var)

ritest Treatment _b[Treatment], reps(1000) cluster(CL_var)  strata(Country) kdensityplot: reg  partygov  Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country , vce(cluster CL_var)


*******FIGURE A3*******

clear all
use Data.dta
	
center      Age   Date  Date2  Deaths Cases  , inplace standardize  nolabel 
 
***STF dem******

quietly: reg Stfdem2 Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country if countryregion!="Austria" , vce(cluster CL_var)
est store Austria 
quietly: reg Stfdem2 Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="Denmark" , vce(cluster CL_var)
est store Denmark
quietly: reg Stfdem2 Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="France" , vce(cluster CL_var)
est store  France
quietly: reg Stfdem2 Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="Italy", vce(cluster CL_var)
est store Italy
quietly: reg Stfdem2 Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="Netherlands" , vce(cluster CL_var)
est store Netherlands
quietly: reg Stfdem2 Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="Spain", vce(cluster CL_var) 
est store Spain
quietly: reg Stfdem2 Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="United Kingdom" , vce(cluster CL_var)
est store UK

	   grstyle init
	 grstyle set legend 2,  nobox
	 grstyle set size 8pt: tick_label key_label
	 grstyle set size 12pt: heading
	 grstyle set size 10pt: subheading axis_title
grstyle set color  "230 230 230" "200 200 200" "160 160 160"  "120 120 120"  "90 90 90"  "45 45 45"  "0 0 0"   
graph set window fontface default
	 grstyle set graphsize 18.5cm 13cm
	coefplot  Austria   Denmark France Italy  Netherlands Spain UK ,  drop( Deaths  Date Age Female Rural Immigrant University Vote   _cons   *.Country )       xline(0,  lpattern(dash)   ) msymbol(s)  levels(95) ciopts(recast(. rcap))     ylabel(, grid)  legend(position(12) rows(1) size(vsmall))    yscale(alt noline)    baselevels subtitle("{bf:Satisfaction with democracy}")    



quietly: reg Trust2 Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country if countryregion!="Austria" , vce(cluster CL_var)
est store Austria 
quietly: reg Trust2 Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="Denmark" , vce(cluster CL_var)
est store Denmark
quietly: reg Trust2 Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="France" , vce(cluster CL_var)
est store  France
quietly: reg Trust2 Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="Italy", vce(cluster CL_var)
est store Italy
quietly: reg Trust2 Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="Netherlands" , vce(cluster CL_var)
est store Netherlands
quietly: reg Trust2 Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="Spain", vce(cluster CL_var) 
est store Spain
quietly: reg Trust2 Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="United Kingdom" , vce(cluster CL_var)
est store UK

	   grstyle init
	 grstyle set legend 2,  nobox
	 grstyle set size 8pt: tick_label key_label
	 grstyle set size 12pt: heading
	 grstyle set size 10pt: subheading axis_title
grstyle set color  "230 230 230" "200 200 200" "160 160 160"  "120 120 120"  "90 90 90"  "45 45 45"  "0 0 0"  
graph set window fontface default
	 grstyle set graphsize 18.5cm 13cm
	coefplot  Austria   Denmark France Italy  Netherlands Spain UK ,  drop( Deaths  Date Age Female Rural Immigrant University Vote   _cons   *.Country )       xline(0,  lpattern(dash)   ) msymbol(s)  levels(95) ciopts(recast(. rcap))     ylabel(, grid)  legend(position(12) rows(1) size(vsmall))    yscale(alt noline)    baselevels subtitle("{bf:Trust in government}")    


quietly: reg partygov Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country if countryregion!="Austria" , vce(cluster CL_var)
est store Austria 
quietly: reg partygov Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="Denmark" , vce(cluster CL_var)
est store Denmark
quietly: reg partygov Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="France" , vce(cluster CL_var)
est store  France
quietly: reg partygov Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="Italy", vce(cluster CL_var)
est store Italy
quietly: reg partygov Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="Netherlands" , vce(cluster CL_var)
est store Netherlands
quietly: reg partygov Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="Spain", vce(cluster CL_var) 
est store Spain
quietly: reg partygov Treatment  Deaths  Date Age Female Rural Immigrant University Vote i.Country  if countryregion!="United Kingdom" , vce(cluster CL_var)
est store UK

	   grstyle init
	 grstyle set legend 2,  nobox
	 grstyle set size 8pt: tick_label key_label
	 grstyle set size 12pt: heading
	 grstyle set size 10pt: subheading axis_title
grstyle set color  "230 230 230" "200 200 200" "160 160 160"  "120 120 120"  "90 90 90"  "45 45 45"  "0 0 0"  
graph set window fontface default
	 grstyle set graphsize 18.5cm 13cm
	coefplot  Austria   Denmark France Italy  Netherlands Spain UK ,  drop( Deaths  Date Age Female Rural Immigrant University Vote   _cons   *.Country )       xline(0,  lpattern(dash)   ) msymbol(s)  levels(95) ciopts(recast(. rcap))     ylabel(, grid)  legend(position(12) rows(1) size(vsmall))    yscale(alt noline)    baselevels subtitle("{bf:Support for PM party}")    


*******TABLE A4*******

clear all
use Data.dta

 
center      Age   Date  Date2  Deaths Cases  , inplace standardize  nolabel 

ebalance Annonce   Age Female Rural Immigrant University Vote  Country

local  CountryFE
local  TimeFE   
local  Demographics
local  Attitudes 
local  Weights
 
quietly: reg  Stfdem2  Annonce  Deaths  Date Age Female Rural Immigrant University Vote i.Country  , vce(cluster Date)
est sto i1
estadd local CountryFE "Yes"
estadd local TimeFE "Yes"
estadd local  Demographics "Yes"
estadd local  Attitudes "Yes"
estadd local Weights "Yes" 

quietly: reg  Trust2  Annonce  Deaths  Date Age Female Rural Immigrant University Vote i.Country  , vce(cluster Date)          
est sto i2
estadd local CountryFE "Yes"
estadd local TimeFE "Yes"
estadd local  Demographics "Yes"
estadd local  Attitudes "Yes"
estadd local Weights "Yes" 

quietly: reg  partygov2  Annonce  Deaths  Date Age Female Rural Immigrant University Vote i.Country , vce(cluster CL_var) 
est sto i3
estadd local CountryFE "Yes"
estadd local TimeFE "Yes"
estadd local  Demographics "Yes"
estadd local  Attitudes "Yes"


esttab  i1 i2 i3, replace se obslast collabels(, none)  star(* 0.1 ** 0.05 *** 0.01)  wrap     booktabs mlabel("a" "b" "c"  )   nonumbers cells(b(star fmt(3)) se(fmt(3) par)) compress label title(Effect of lockdown announcements on political support.)   drop(_cons *.Country )  gaps   stats(  CountryFE  TimeFE Demographics      N r2, fmt(a1 a2  a4   %9.0fc %9.3fc )  labels( `"Country FE"'  `"COVID-19 incidence"' `"Controls"'    `"N.obs"' `"R-squared"') )   


*******TABLE A5*******

clear all
use Data.dta
	
la var School "School closing"
la var Workplace "Workplace closing"
 
 
quietly: reg  Stfdem2 School  Deaths  Date Age Female Rural Immigrant University Vote i.Country, vce(cluster Date)
est sto i1
estadd local CountryFE "Yes"
estadd local TimeFE "Yes"
estadd local  Demographics "Yes"
estadd local  Attitudes "Yes"

quietly: reg  Trust2  School  Deaths  Date Age Female Rural Immigrant University Vote i.Country , vce(cluster Date)          
est sto i2
estadd local CountryFE "Yes"
estadd local TimeFE "Yes"
estadd local  Demographics "Yes"
estadd local  Attitudes "Yes"

quietly: reg  partygov  School  Deaths  Date Age Female Rural Immigrant University Vote i.Country, vce(cluster CL_var) 
est sto i3
estadd local CountryFE "Yes"
estadd local TimeFE "Yes"
estadd local  Demographics "Yes"
estadd local  Attitudes "Yes"


esttab  i1 i2 i3 , replace se obslast collabels(, none)  star(* 0.1 ** 0.05 *** 0.01)  wrap     booktabs mlabel("a" "b" "c" )   nonumbers cells(b(star fmt(3)) se(fmt(3) par)) compress label title(Effect of school closing.)   drop(_cons *.Country )  gaps   stats(  CountryFE  TimeFE Demographics     N r2, fmt(a1 a2 a3    %9.0fc %9.3fc )  labels( `"Country FE"'  `"COVID-19 incidence"' `"Controls"'   `"N.obs"' `"R-squared"') )  mgroups("Political support" "Placebo", pattern(1 0 0  1 0 0 ) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 


*******TABLE A6*******

quietly: reg  Stfdem2  Workplace  Deaths  Date Age Female Rural Immigrant University Vote i.Country, vce(cluster CL_var)
est sto i1
estadd local CountryFE "Yes"
estadd local TimeFE "Yes"
estadd local  Demographics "Yes"
estadd local  Attitudes "Yes"

quietly: reg  Trust2  Workplace  Deaths  Date Age Female Rural Immigrant University Vote i.Country , vce(cluster CL_var)          
est sto i2
estadd local CountryFE "Yes"
estadd local TimeFE "Yes"
estadd local  Demographics "Yes"
estadd local  Attitudes "Yes"

quietly: reg  partygov  Workplace  Deaths  Date Age Female Rural Immigrant University Vote i.Country, vce(cluster CL_var) 
est sto i3
estadd local CountryFE "Yes"
estadd local TimeFE "Yes"
estadd local  Demographics "Yes"
estadd local  Attitudes "Yes"


esttab  i1 i2 i3 , replace se obslast collabels(, none)  star(* 0.1 ** 0.05 *** 0.01)  wrap     booktabs mlabel("a" "b" "c")   nonumbers cells(b(star fmt(3)) se(fmt(3) par)) compress label title(Effect of workplace closing.)   drop(_cons *.Country )  gaps   stats(  CountryFE  TimeFE Demographics     N r2, fmt(a1 a2 a3    %9.0fc %9.3fc )  labels( `"Country FE"'  `"COVID-19 incidence"' `"Controls"'   `"N.obs"' `"R-squared"') )  mgroups("Political support" "Placebo", pattern(1 0 0  1 0 0 ) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 


	 